-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
server: create api to trigger table metadata update job #130721
Conversation
013a51c
to
20e46e0
Compare
c6dc399
to
afcf872
Compare
c49c4d9
to
3479f41
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Excited to connect this to the new pages. Mostly testing comments - feel free to merge after addressing them.
@@ -4211,7 +4211,7 @@ func (s *statusServer) localUpdateTableMetadataCache() ( | |||
select { | |||
case s.updateTableMetadataJobSignal <- struct{}{}: | |||
default: | |||
return nil, status.Errorf(codes.Unavailable, "update table metadata cache job is not ready to start execution") | |||
return nil, status.Errorf(codes.Aborted, "update table metadata cache job is not ready to start execution") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, why the switch to aborted here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that typically, the unavailable status should be used for when the service is temporarily unavailable, where as the aborted status should be used when an operation is aborted. To me this case falls under an latter.
adds a new API v2 endpoint, `POST /api/v2/table_metadata/updatejob`. This new API will trigger the table metadata update job to run and refresh the system.table_metadata table. This will only trigger the job if it isn't already running. If the `?onlyIfStale` query param is provided, the job won't be triggered unless deemed stale, determined by the following setting: `obs.tablemetadata.data_valid_duration` note that `onlyIfStale` with any value other then `false` will be treated as true. Resolves: cockroachdb#128897 Epic: CRDB-37558 Release note: None
3479f41
to
c992988
Compare
tftr bors r+ |
adds a new API v2 endpoint,
POST /api/v2/table_metadata/updatejob
.server: create api to trigger table metadata update job
adds a new API v2 endpoint,
POST /api/v2/table_metadata/updatejob
.This new API will trigger the table metadata update job
to run and refresh the system.table_metadata table.
This will only trigger the job if it isn't already
running. If the
?onlyIfStale
query param isprovided, the job won't be triggered unless deemed
stale, determined by the following setting:
obs.tablemetadata.data_valid_duration
note that
onlyIfStale
with any value other thenfalse
will be treated as true.Resolves: #128897
Epic: CRDB-37558
Release note: None